package com.iptv.grape.ui.control.ad;

import android.os.AsyncTask;

import com.iptv.grape.domain.IListViewShowItem;

import java.util.List;

public class ChListTask extends AsyncTask<Object, Void, List<IListViewShowItem>> {

    private ListViewUI listViewUI;

    @Override
    protected List<IListViewShowItem> doInBackground(Object[] params) {
        IListViewShowItem item = (IListViewShowItem)params[0];
        listViewUI = (ListViewUI)params[1];
        return item.getChList();
    }

    @Override
    protected void onPostExecute(List<IListViewShowItem> result) {
        if(listViewUI.getNextListViewUI() != null){
            if(result != null && result.size() > 0){
                this.listViewUI.getNextListViewUI().show();
                this.listViewUI.getNextListViewUI().refresh(result);
            }
            else {
                this.listViewUI.getNextListViewUI().hide();
            }
        }
    }

}
